# Maintainer: Sven-Hendrik Haase <svenstaro@archlinux.org>
# Contributor: juergen <juergen@archlinux.org>
# Contributor: Manolis Tzanidakis, Petter Gundersen

pkgname=scummvm
pkgver=2.7.1
pkgrel=1
pkgdesc="A 'virtual machine' for several classic graphical point-and-click adventure games."
arch=('loong64' 'x86_64')
license=('GPL')
url="http://www.scummvm.org/"
depends=('libpng' 'libtheora' 'sdl2' 'sdl2_net' 'fluidsynth' 'flac' 'faad2' 'libvorbis' 'libmad' 'freetype2'
         'libgl' 'glu' 'libjpeg-turbo' 'libmpeg2' 'curl' 'a52dec' 'giflib' 'glew' 'libspeechd' 'gtk3' 'sndio')
makedepends=('mesa')
source=("https://downloads.scummvm.org/frs/${pkgname}/${pkgver}/${pkgname}-${pkgver}.tar.xz")
sha512sums=('7fcefb849822c84df3f8c9b8c91c8ea15cdd4597404c927fda3b2ba0a6a18e82917be9511244d8ba8f693df8bfa2d368bdebdd4caaa9905007ce0463cc693760')
b2sums=('a74ede3ea8e128d2ab28cac897ef372c1bbcb79de8afdb86c1d30323ddc4c23f72a2f98ee4023d548961d339b89362c50e7e58e358a00a3017950f5bd0e93774')

build() {
  cd ${pkgname}-${pkgver}
  ./configure \
    --enable-release \
    --enable-all-engines \
    --prefix=/usr
  make
}

package() {
  cd ${pkgname}-${pkgver}
  make DESTDIR="${pkgdir}" install
  install -vDm644 dists/${pkgname}.desktop -t "${pkgdir}"/usr/share/applications/
}
